package main

import (
	"fmt"
	"net/rpc"
)

type ArgsX struct {
	A, B int //两个数据
}

type Query struct {
	X, Y int //两个数据
}

func main() {

	client, err := rpc.DialHTTP("tcp", "127.0.0.1:1234")
	if err != nil {
		fmt.Println(err)
	}

	args := ArgsX{13, 5}

	var reply int

	err = client.Call("Last.Multiply", args, &reply)
	if err != nil {
		fmt.Println(err)
	}

	fmt.Println(args.A, "*", args.B, "=", reply)
	fmt.Println()

	var qy Query

	err = client.Call("Last.Divide", args, &qy)

	if err != nil {
		fmt.Println(err)
	}

	fmt.Println(args.A, args.B, qy.X, qy.Y)

}
